package com.study.proxy;

import com.study.proxy.cglib.CglibBugHouse;
import com.study.proxy.cglib.CglibBugHouseProxy;
import net.sf.cglib.proxy.Enhancer;

public class CglibProxy {

	public static void main(String[] args) {

		CglibBugHouse buyHouse = new CglibBugHouse();
		Enhancer enhancer = new Enhancer();
		enhancer.setCallback(new CglibBugHouseProxy());
		enhancer.setSuperclass(buyHouse.getClass());

		CglibBugHouse buyHouseproxy= (CglibBugHouse)enhancer.create();
		buyHouseproxy.buyHouse();
	}
}
